IdeaBlade DevForce 2010 Help Reference
RegisterCallback(String,String,Action<SubscriptionOperation>,Object,Object[]) Method
See Also  Send Feedback
IdeaBlade.EntityModel Assembly > IdeaBlade.EntityModel Namespace > EntityManager Class > RegisterCallback Method : RegisterCallback(String,String,Action<SubscriptionOperation>,Object,Object[]) Method



serviceTypeName
Name of type containing the service method
serviceMethodName
Name of service method
callback
Client method handling the pushed data
userToken
Token identifying the request
clientArgs
Optional arguments which can be passed to server code
Register a client subscription to a server "push" method.

Syntax

Visual Basic (Declaration) 
Public Overloads Sub RegisterCallback( _
   ByVal serviceTypeName As String, _
   ByVal serviceMethodName As String, _
   ByVal callback As Action(Of SubscriptionOperation), _
   ByVal userToken As Object, _
   ByVal ParamArray clientArgs() As Object _
) 
Visual Basic (Usage)Copy Code
Dim instance As EntityManager
Dim serviceTypeName As String
Dim serviceMethodName As String
Dim callback As Action(Of SubscriptionOperation)
Dim userToken As Object
Dim clientArgs() As Object
 
instance.RegisterCallback(serviceTypeName, serviceMethodName, callback, userToken, clientArgs)
C# 
public void RegisterCallback( 
   string serviceTypeName,
   string serviceMethodName,
   Action<SubscriptionOperation> callback,
   object userToken,
   params object[] clientArgs
)
C++/CLI 
public:
void RegisterCallback( 
   String^ serviceTypeName,
   String^ serviceMethodName,
   Action<SubscriptionOperation^>^ callback,
   Object^ userToken,
   ... array<Object^>^ clientArgs
) 

Parameters

serviceTypeName
Name of type containing the service method
serviceMethodName
Name of service method
callback
Client method handling the pushed data
userToken
Token identifying the request
clientArgs
Optional arguments which can be passed to server code

Exceptions

ExceptionDescription
System.ArgumentNullExceptionThrown if the callback action is not provided
System.ArgumentExceptionThrown if the serviceTypeName is not fully qualified
System.NotSupportedExceptionThrown if called from server code

Remarks

Use RegisterCallback to register a client for messages or data "pushed" from the server. The serviceTypeName and serviceMethodName parameters indicate the method on the server which performs processing which the client wants to "subscribe" to. The callback indicates the client-side method which will be called whenever the server method pushes data. The userToken should be used to identify the client request. It does not have to be unique acrosss all clients, but it must be unique for all requests from a single client. The clientArgs can be used to pass argument data from the client through to the server. The server code can query for these arguments using the INotificationManager.GetSubscribers method.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.